# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import matplotlib.pyplot as plt
import networkx as nx
import matplotlib.pyplot as plt

# 创建一个图对象
G = nx.Graph()

# 添加顶点和边（这里需要根据具体数据来添加）
# 示例：添加顶点
G.add_node("A")
G.add_node("B")
G.add_node("C")

# 示例：添加边
G.add_edge("A", "B")
G.add_edge("B", "C")
G.add_edge("C", "A")

# 绘制图
nx.draw(G, with_labels=True, font_weight='bold', node_size=700, node_color="skyblue", font_size=10)
plt.title("基础关系网图")
plt.show()
# 设置matplotlib支持中文显示
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']


def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
